A mallet will always be the preferred option but there are exceptions.
If you’re working away from the workshop and on site, there’s a lot of hand tools you don’t really have space for in your bag, also it would be too heavy to carry around.
The mallet is one and what they teach you at...