Why are there so many? Because English is partially derived from Romance languages that use both Latin and Greek root words, and Latin and Greek had a lot of numerical prefixes.
Primary, Secondary, Tertiary: These are Latin ordinal prefixes.
Pentagon, Hexagon, Heptagon: These are Greek cardinal prefixes.
Billion, Trillion, Quadrillion: These are Latin cardinal prefixes but
use the multiple prefix for 2.
Unity, Duality, Trinity: Latin cardinal prefixes again.
Methane, Ethane, Propane: IUPAC nomenclature. The first four are
derived from existing chemical names and they then switch to Greek
As to how to choose...you just have to learn them. You can try to learn the sequences from that wikipedia link, but it's not unusual for a series to switch system partway through, as your examples demonstrate.