Obviously, its parents had shells, and it inherited from them. But how did the mom and dad turtle get their shells? Obviously, their parents had shells and they inherited the shell from them! But how did ….
OK, actually, this is complicated. Do you have a spare nine minutes and 11 seconds?
The fossorial theory of turtle evolution, from PBS Digital Studios:
Notice the different perspectives of the phylogenetic and the ontogenetic. That is part of the Tinbergean method. If you want to explore that more, see: Ebola Will Not Become Airborne And Here Is Why