Session IDs are essentially just random numbers. It's HIGHLY unlikely, but NOT impossible for two or more users to get the same session ID.
PHP does (I believe) check if there's another session currently using the ID it's just generated. If there's a collision, it'll just generate another one, and keep trying until something "unique" comes up. However, this doesn't prevent the case where:
- user A gets session ID 'X'
- user A goes away for a while and session 'X' gets expired
- user B shows up, and the server generates session ID 'X' again by random chance
- user A comes back with their original session X cookie ID and gets user B's session.
Again, given the size of the session ID space, it's very very very unlikely for this to occur. But also again, it's not impossible.
Beyond that, there are cases where broken/misconfigured proxy servers get cookies confused and basically 'cross wires' so that session IDs get mixed up between different users. I remember a case where a mobile operator's gateway did just that, and people on a certain model of smartphone were getting other people's sessions instead of the one they'd been on.