Largely, it's a company-by-company, team-by-team, person-by-person, and even culture-by-culture basis on how "small talk" works. Some people are more sociable and can get everyone to gel into a conversation on safe topics (weather, vacation plans, weekend events, current non-political events, etc.).
Most of the time, it is used to fill the gap of time when an event is waiting to be started or to get people to ease into a conversation (sometimes it just helps kill 5 mins or break the ice). Some people are more of a "down to brass tacks" right away kind of personality so they either probably do not want to do the small-talk thing or they just want to wait in silence until any other required attendees join.
Again, it's largely driven by the group dynamics you're in. Try to figure out if there's chit-chat before/after meetings, at lunch, just in passing at common areas like water cooler, cafe counters, etc. ... fun tidbit: those are why those places exist: not to serve coffee/water but to get people talking, communicating, and building rapport.
On a personal note, I like to initiate some small-talk before a meeting starts (if I hop on early or we're waiting for someone else to join) or if we're in a meeting where we are waiting on something like a compilation result, loading an app/container/server, etc. It just keeps everyone engaged and keeps it light/fun to show we're humans. I know some people who like the first 5 mins of any meeting just to be chit-chat to get the ice to break. Others are more "Ok, here's the code where we are generating .... " and straight-to-it.
Just go with the flow and don't worry, be mellow about it all :)