Croatia is hugely dependent on tourism. Serbia does not have access to nice beaches and islands on the Mediterranean. In addition, its exports to the EU are taxed quite heavily
Yet the average Croatian has a higher household income, life expectancy at birth, and literacy rate than Serbia - despite Croatia having a lower HDI than Serbia in the 1990s, and lacking any major cities or industries (which were concentrated in Bosnia and Serbia during the Yugoslav era)
Oh also to add, regarding literacy rates, even before WW1 because Croatia and Slovenia were Austro-hungarian, and the rest was Ottoman, the literacy rates were way different, with the former being much much higher. Currently, its probably about the same with Croatia and Serbia.