It was developed independently of Bedrock by a different studio. For example, Mojang were the main developers of Bedrock which was intended (originally) for mobile devices. However the Legacy Editions were made independently by 4J-Studios, they were simply contracted by Mojang to create said Legacy Versions.
There are indeed some similarities, but they are not based off of each other. Take this from someone who quite often dealt with editing, analyzing, and creating things from multiple versions of the Legacy Executables. In short - different studios, different methods of creation, just contracted / owned by the same company.