If you think coding "is the most lightweight task you can perform on a computer.". I suspect you haven't done much coding. You certainly haven't tried to build a large C++ project.
Its true that Sublime is a very light weight editor but the popular VS Code certainly is not. Neither are all the other Electron apps developers often use (e.g. Slack). Then if you are doing web development you probably need Chrome.
The well regarded JetBrains IDEs can use several gig. I have seen large C++ projects in CLion use over 8GB of RAM and that is just the IDE.
Then there are virtual machines and local Kubernetes clusters. They aren't exactly economical with RAM.
You’re exactly right, I was just emphasizing how “coding” can mean anything, from pushing commits to a remote from a vim/git combination all the way to what you describe.
I’ll add to the developing scenario that besides slack nowadays you might also have to switch between meetings from zoom to ms teams to google meet.
This all eats into RAM of course. Some apparently also like to run antivirus software on their Macs while “developing”, no wonder RAM disappears like a cup of water in the Sahara.