At the end of WW2 there were huge amount of population movements and exchanges (e.g. Sudeten Germans), Tito and his communists had an opportunity to re-draw Croatia/BiH/Serbian borders to make them homogenous, and expelled Hungarian & Albanian minorities that were nazi collaborators during WW2, however the communists chose to leave a large Serbian minority in Croatia and BiH (which acted as a kill switch for peaceful independence of Croatia & BiH) and left a large minority of Albanians and Hungarians in Kosovo and Vojvodina (which acted as a kill switch for peaceful independence of Serbia) and a sizeable Albanian minority in Macedonia (which acted as a kill switch should Macedonia want independence), the only Yugoslavia republic to not have a kill switch was Slovenia (and that is because Tito was ethnic Slovenian).