It might be surprising, but there’s not much clarity around the origins of the names Buda, and Pest. The word Buda could be related either to the brother of Attila the Hun or to the abundance of thermal springs of this area, linking it to the Slavic term for water “voda”.
Pest could derive from a Slavic word too, meaning “cave”.
What we know for sure is that for a while the two cities were known as Pest-Buda, which made sense population-wise, but became impractical after the unification (1873). When looking at a map, Buda is on the left, Pest on the right of the Danube, making Budapest the most logical choice.