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?