Making your own custom post views count

For example, how does “Most Popular Posts” plugin calculate views.

Do they simply update custom post meta_value +1 every time there’s a page refresh?

Yes some do that yes, but using post meta and updating it on every visit will give you wildly inaccurate results due to race conditions, is incompatible with page caching/CDNs, and introduces database writes to the frontend which is bad for performance. You should not store and track the data yourself, nor is PHP based tracking suitable for most sites. Avoid those plugins for that reason.

Instead, you want to rely on external software that was built to do this. This usually means relying on a 3rd party service then using its API to request the data at regular intervals, or integrating directly with software on the same server designed to track this.

Also keep in mind that there are legal compliance obligations to consider. In many countries, the EU, parts of the USA, you must make it clear and provide opt-ins/opt-outs. The precise requirements will vary from region to region so I recommend getting legal advice.