Latin ūniōn- meant "oneness, unity" - understandably, since it's derived from ūnus "one". But it also meant "a single large pearl", and "a kind of single onion". Onion is from Anglo-Norman vngeon, oignon, oinion etc, in the 12th-13th centuries, while union is borrowed from French union in the 15th century.
So what's the connection between "oneness" and "onion" and "pearl"? The OED says
According to the classical Latin agricultural writer Columella, the peasants used ūniō for a certain variety of onion because it put forth no shoots, i.e. it represented a single entity. The application of the word to a pearl may represent an independent derivation from ūnus one, alluding to the fact that it was worn alone, or it may be a transfer from the sense ‘onion’, with reference to the similarity in shape.