Why are some elements diatomic under normal conditions while others are not?

I see that the the standard form of many elements are diatomic molecules under normal conditions (eg oxygen, hydrogen and iodine are usually seen as diatomic molecules) and are all among the most electronegative, and I understand it has to do with energy and stability, but I just have no clue why other elements wouldn't be the same.


What explains why some appear as diatomic molecules and others do not?


