Gohan, thanks to his mothers influence didn't grow up with any desire to fight in his heart. This lack of fighting spirit was a big part of his development. During the fight with Nappa, Gohan was too scared to fight him due to fearing for his life and not wanting to get hurt which stopped him from attacking Nappa when he had the chance to deal major damage to him. When he finally got attacked by Nappa he realised the pain was nothing to be afraid of hence why he was more eager to fight Nappa afterwards to protect Piccolo. However, Gohan's fear still led to Piccolo's death, which greatly affected him. It made him realise that caring for his own well being isn't worth it in the end and made him determined never to repeat his mistake.
His development in the Saiyan arc is what led to him putting the greater cause over his own well being so readily in the Namek arc. However, instead of eliminating his fear for his own well being he was suppressing it and thus was suppressing the key to controlling his hidden power.
Gohan willingly puts his principle/well being aside when it comes to fighting, and was ready to kill during fights, which made him unable to fully control his power during all those rage boosts he had because deep in his mind, he felt if he killed, he'd commit a sin. Meaning that he'd rather commit a sin than not fight for a greater cause than himself, but the thought of committing a sin was what ultimately held him back. This was perfect for Gohan's character since he's the only Z-Fighter who had rage boosts and is not a fighter at heart, while other characters can control themselves when it comes to killing.
A situation never arise where his belief that killing is a sin came to surface before the Cell Games. Gohan believed the Cell Games was pointless and thus put his principle on the forefront as a result. It took 16's speech while seeing his friends get tortured to make Gohan think more on his belief that killing is a sin and how it relates to his powers, realising the key to unlocking his power was believing that none of what he was doing was wrong, which led to him letting go. The fact that it was even harder for Gohan to get a rage boost during the Cell Games than before made Gohan knew his reason for being reluctant to fight in the Cell Games was what held his power back all along. His actions as a SSJ2 also demonstrated the side of himself that he feared which also relates to his belief that killing is a sin - The hate he feels and his desire to torment those he hates before killing them (Villains in general) as shown by his desire to torture Cell. But because 16's speech made him feel unleashing that hate was not a sin, he allowed himself to be controlled by the hate which led to his father dying. This was a pivotal moment for Gohan, because his actions led to him learning why it's wrong to have those kind of intentions, even if it's not a sin (Which is a great message). The guilt Gohan felt for causing his father's death was too much for him to bear, hence why he was happy that Cell returned despite how much more powerful he became, because he had a chance to atone for his actions by killing Cell the right way.
Gohan indeed put fighting over his life, but unlike his father, he fought for what he believed to be a greater cause rather than his personal desire. Like his father, he found an equilibrium between his conflicted nature, the main difference being that Gohan became a better protector of earth than his father who could only reach his equilibrium by staying dead because he's a Saiyan, making the themes of belonging in DBZ even better.
Gohan was confident in himself after finding his equilibrium in the Cell arc, which was one of the reasons why he was enjoying himself in Babidi's spaceship and was excited to fight Dabura despite the earth being in danger. The classic line against Super Buu "Fight you? No, I want to kill you." showed how much Gohan has grown. Him saying it with a smug expression showed he's fully confident in the idea that there's nothing wrong in fighting for a greater cause.





