LEDs typically are manufactured with mechanical/dimensional differences between the leads, and often with a mechanical asymmetry or keying feature to the base of the overmold.
Automated handling from tape should never get them wrong, if properly engineered. Manual handling can involve mistakes, but a post-insertion visual check can be done based on LED features.
When the lens/overmold is transparent, it's also possible to observe orientation by looking at the internal structure. This can be done on an automated basis with video and pattern recognition, or manually either with direct optical magnification or with video.