It's most a tradeoff between management effort and easy of use.
An adblocker will usually run inside the browser, and have some performance impact. They will use memory and CPU time to parse the incoming HTML data, search his internal database to match ads, and remove them from the page. All that incurs some performance penalty. The biggest benefit is that it is a fire-and-forget approach: you choose the adblocker, install it, and it's done.
On the other hand, a hosts file (or DNS server like PiHole) will work on network level. All requests from the blacklisted domains will return an invalid or unreachable address (configurable), so the client will not spend any resources blocking anything. As it works at network level, every program on your computer, and every computer on your network will be protected.
On the downside, it needs more administration. If you install PiHole, you need to be comfortable with installing Linux services, will probably need a dedicated device, and will need to manage this device to keep it running.
If you keep a hosts file, you will need a script or program to manage it and keep it updated. Performance impact will be way less than running a program inside the browser to parse HTML using regex.