I try to explain that when you're solving problems, it's kind of like exploring a vast, dark, unknown territory to find the boundaries. This exploration takes an unknown amount of time, there's a lot of trial and error, and eventually you will have mapped out the problem you're trying to solve. This stage of development might be discouraging, but it's not usually exhausting.
Once you start coming up with a solution to the problem that you now know to shape of, that's where things can get mentally strenuous. Programming is like building architecture with your thoughts, so as you are working on writing your solution you might have many different things going on that you're trying to keep track of. Like a juggler with balls in the air, or a plate spinner trying to keep all of the plates spinning, this is the part that requires the most concentration for me. Some days I just don't have enough energy left to tackle a problem and have to come back with renewed strength.
I guess the way I'd explain it is like, even though the physical act of tossing balls into the air isn't exhausting (sitting down and typing keys on a keyboard is one of the least "active" physical activities) however juggling balls for hours (tossing them in the air with precision and coordination, keeping the flow going, etc) is really mentally exhausting. Programming is like that.
Also: beware of the post-programming-snark! I've heard from multiple programmers that once they are done a long stretch of coding they often feel short and maybe even rude to other people until they recover. If a programmer is rude to you right after coding that might be why, and try to remember to be kind to others when you're done programming too!