It's not very quick but it's relatively simple. Your premium version needs key algorithms or data to sit on a server of yours.
The plugin comes in a free version that talks to your server's "free, public API" and gets limited / worse / free stuff out of it.
They payware version involves the customer entering a registered API key they must purchase from you. That key is recognized by your server and it delivers premium data.
Of course, what to give away or to keep past the pay-wall is for you to decide. Some plugins are straightforward, all you need to do is to give limited data / "runs per day" / "dumber algo" and you are done.
Others need to provide limited data but lots of real time features, in this case it's going to be much harder to keep functionality on your server. But it's still done, look at some of the most famous WP plugins, their "pro" version usually works like I have described.