I saw a programme about how it is all separated a while ago
They started off with a vibrating conveyor belt that basically just got everything spread out and spread out
then passed it under a massive magnet that grabbed all the iron and steel and took it of elsewhere
Then it passed under another magnet thing that induced a current in other metals - mostly Aluminium - and then another magnet thing could grab all that
Then they had a camera linked up to a computer that could detect glass by the shape. Thing about that was that it could easily see anything like a bottle
unless it was black - the optics could not see black bottles!
Plastic bottle were grabbed the same way further on
I am sure this had developed a lot with AI being able to detect other things more easily but that was how it was done in that place at the time
I suspected when I was watching it that they were probably hiding the more "mucky" bits but the front end bits were pretty impressive