The Prva Liga, operated by the Football Association of Yugoslavia, began holding national competitions in 1923. This spawned many new opportunities for teams to be organized, and prospective footballers looking to join. The boom began right after the First World War, and continued well until the break out of the Second World War.
Following World War II, many teams were either "renovated" with new management and players, or simply dissolved and leaving a vacuum needing to be filled by new teams. Many of those "Post-war" teams are still in existence and turned to be the most successful teams in the former Yugoslavia.
References
Yugoslav football clubs Wikipedia(Text) CC BY-SA