In my office, I see the same thing. Myself and some others tend to be heads down, work work work, but that's because we have a LOT of work to do, and only 8 hours a day to get it done in. The joys of working in a large production environment that is constantly growing
Beside our group are 2 groups of people who work in labs, testing things before they go into prod. they seem to frequently have time to stand around, chat, have lunch (what a novelty!) etc, while myself and a couple others rarely have enough free time to grab some lunch and eat it in peace.
For a long time, it drove me nuts (and still does when I'm having a hectic day and hear them laughing it or, or worse, they come into our group just to chat), but I came to the conclusion that so long as i am getting what I have committed to doing done, I don't care what others do. My teamlead and manager have set expectations, I have my own expectations, and so long as I meet those, then I am content. It can get frustrating when work isn't evenly distributed, but I look at that as partly my fault, for taking on extra work and striving to deliver something that doesn't simply meet requirements. I can't fault others for my own expectations.
Plus, I decided to try and join them occasionally for social time,and find that it actually helps. When everyone is standing around chatting, I not only get a break, but I get to know my coworkers better, so when I, or they, need help with a problem, it's much easier to approach and relate and get things done quickly. It's a tradeoff in time, and I use it liberally, but it's good to get up from my desk and give my brain a break sometimes.
The sooner you realize that you can't change how others work, only how you work, and that some people will always seem to get away with doing nothing for some reason, the sooner you'll find comfort/peace in the workplace. If you really want to fix things, work your way into a TL position, or even just a leadership position of some sort, so you can nudge people the way you think they should go. ultimately though, it's up to the person, and their manager, to adjust a work ethic.
Best of luck!