It is the power of faith. Read Hebrews 11:24–26: By faith Moses, when he was grown up, refused to be called the son of Pharaoh’s daughter, choosing rather to be mistreated with the people of God than to enjoy the fleeting pleasures of sin. He considered the reproach of Christ greater wealth than the treasures of Egypt, for he was looking to the reward.
Moses had the choice: to live as a prince in wealth and luxury, or to join his brothers who are oppressed. He chose to join the fate of the slaves rather than to stay aside.
12 He looked this way and that, and seeing no one, he struck down the Egyptian and hid him in the sand.