Ferris Bueller Question

Why were Ferris and Cameron friends?

They seemed to be on opposite ends of the popular/cool spectrum

To me there are two possibilities:

1: Ferris is nowhere near as popular or cool as he thinks he is. He’s definitely the “cool” one of the two but no one else thinks that

The rest of the movie makes it clear, that Ferris is that popular. So that theory is out

2: Ferris and Cameron have been best friends, thick as thieves, close as brothers since kindergarten, somewhere around 7th or 8th grade their social standing began to change but because they’ve been so close for so long Ferris stayed close to him (to his credit, a lot of people would have dropped Cameron)
And Ferris was so popular he was able to withstand being friends with him (again to his credit, many would have succumbed to the peer pressure of ‘why do you hang around him?)

I’m sure if I thought about I could think of other theories but their friendship has always struck me as a bit odd, they definitely don’t seem like they run in the same circles