Head and Shoulders is based on zinc and Selsun is based on Selenium. If you are a chemist, you will spot the similarity between these two atoms straight away. If you aren't, take my word, they are similar.
It isn't surprising that they act in much the same way on the scalp. The interesting thing would be to work out which one works best. I am pretty sure that both of these products can and no doubt have been proved to work in a proper clinical trial. What would be fascinating is which one works best and why. As far as I know a trial of one against the other has never been carried out.