How was Moses live in the palace?

Moses lived in the Egyptian palace, as he was adopted by the daughter of Pharaoh.