How does PX4 fit into NuttX?

I am very new to PX4 and NuttX, and Iā€™m trying to understand how PX4 and NuttX co-exist. Iā€™ve built NuttX standalone plus I managed to hack the nxp_fmurt1062-v1_default build to run on a Teensy4.1. Now Iā€™m just trying to understand how PX4 starts upā€¦
I see in nuttx documentation that NSH initialization can be customized. Does PX4 run by kicking off a bunch of builtins through NuttX? Is there any documentation on this or can someone point me to some code that starts up the ā€œpx4 applicationā€ within NuttX?