Eye irritation is down to ph.
The eye is very sensitive to even small deviations in PH away from neutral so what baby shampoos do, is ensure the ph is spot on neutral through buffering. This is different to neutral skin detergents as the eyes require a higher and more precisely neutral ph whereas skin shampoos often tend to be more alkaline. How well it's done relates to the level of eye irritation that occurs. eg some own brand baby shampoos irritate the eyes more than proper Johnson's, presumably down to less accurate buffering.
(My chemistry teacher used to be a detergent scientist for a very well known manufacturer of many leading brands.)