That's not true, bar soap gets stuck in hair and doesn't rinse well. Look at the ingredients in soap vs shampoo.
Both have also become more tailored for their use case. For example, shampoos sell better if they create a pleasant lather, and soaps if they also moisturize your skin. Those additives are why a modern bar of soap might not work well in your hair. But pure soap does, and so do some modern soap bars.