Milonga came first. Simple rhythmic beat, repeating 2 beats over and over with a skippety syncopation every other instance.
Tango came next. They spread the milonga beat out into 4 solid beats to slow down the music, creating a frame for richer layers (like other instruments, singer).
Vals is basically the (European) Viennese Waltz, supposedly “the worlds first popular dance), adopted into tango. Typical three beats here.