Recording sessions are usually done independently for scheduling purposes, and dialogue is all synced in post.
Group recording sessions do happen, but they’ve become rare.
Blockbuster animated movies frequently employ massive A-lister casts these days – a trend that launched with Robin Williams’ hailed performance in Aladdin – but what you may not realize is that these performers don’t get a lot of opportunities to actually mingle while the film is being made.