In the story, the "Hollow Knight" is atually not the main prtagonist but the antagonist. The Hollow Knight is a being filled of void, and supposed to be emotionless with no thoughts. The Hollow knight is one of thousands of beings of the same charactersitics, and all of them being siblings. They are a product of more than thousands of experiments by the the "Pale king", also their father, in his futile attempt to contain a desease affecting his kingdom through dreams.
The Pale King, looking for a cure or a way to save his kingdom from the disease spreading through it, found the "Abyss" deep in the earth under his Kingdom. He understood that the disease wouldnt be easily destroyed because it was created by a "Wyrm", a higher being just like himself, so the only way he found was to contain it through a medium. The Abyss, or more so the Void inside of the Abyss, was what the Pale King thought was the answer. However, he was unable to use the void itself to do so, so he thought of having kids with his wife the "White Lady". After being born, his kids would be thrown into the Abyss into the void, where they would be filled with it and most likely die. However, they were some who survided and tried to escape, however, only one wa able to make to the exit, the Hollow Knight.