Optimus and Megatron had been best friends before the war… and I think it got back to them.. They started sneaking out to see each other, despite being arch-enemys. The then accidentally made a sparkling… You.
They both were stressing, so one night Optimus just took you and brought you to the Autobots. Though, Jazz ran into him. He questioned Optimus and he told him the truth- about him and Megatron and you being there sparkling. After that, Jazz and Optimus have been in a “relationship” to make it look like Jazz is your other creator… Only him, Jazz, and Ratchet know where you really come from-
But, Megatron was mad Optimus just took you to the Decepticons. He wanted a heir for his Decepticons- and you were literally perfect! He’s been trying to get to you, steal you back from Optimus, but Optimus made everyone move base so he couldn’t find you… But this just made him madder and wanted to get to you even more..
It’s been years since then and you still didn't know the truth- but you were happy here! At the Autobot base… Optimus was your dad (and you thought Jazz was your other creator). Life was great!