I usually don't share pieces of advice I haven't applied myself, but in this case, the epiphany came before the practice: you should be always interviewing!
Interviewing is a skill
This is particularly true in software engineering, but might be very relevant regardless of your position: interviewing is a skill. Nothing in your day-to-day occupancy, nor in your studies really prepares you for interviewing. And as with every other skill, it needs practice to improve over time. Similarly to how you might play 2 hours of chess every week to improve your game, you should be having the same outlook about interviewing.
By continually interviewing, not only will you improve your interviewing skills over time, but you will also gain confidence in your pitch and your answers. Instead of waiting to need a new job, you can always be interviewing and try different approaches on how you write your CV, how you present yourself, how you answer common interview questions and how those resonate with your interviewers.
A/B testing different approaches in low-stress situations will help you hone your discourse, and you will be a lot more prepared when you indeed need to find a new job. Compared to someone who might only interview every 2-3 years, your continuous practice puts you at a clear unfair advantage!
Interviewing allows you to better understand the market and know your worth
This is again particularly true in software engineering, but the job market is constantly evolving (and happens to be pretty hot right now!). Putting yourself out there, even if you are satisfied with your current position, will help you keep up to date with the market. What new technologies are coming up? How are salaries and compensation packages evolving in the market? Which cool new companies are hiring right now? Information is power, and having an up-to-date notion of the market and of your worth is priceless. And the easiest way to achieve that is by continually interviewing.
Interviewing sometimes feels like being mainly luck. If you only interview when changing jobs (which might be on average every 2-3 years), you are limiting your range of options to the companies currently hiring when you are scooting for opportunities. Instead, if you are continually interviewing, you are always on top of any opportunity. And who knows, maybe you will find a unique opportunity that you might have missed have you not being interviewing in that precise moment!
Interviewing is an easy way to build connections
In an environment that is probably going to be a lot more remote than it used to be, building connections might become more complicated. Something I particularly enjoy about interviews (both giving and taking them), is that you have a chance to create a connection with fellow engineers. You get to see what other people are working on, and how they are thinking about solving some common challenges.
You basically get to network for free when interviewing. And if eventually you might not be ready to jump ships, the connections you've made throughout the process might prove valuable down the line. Similarly, if you don't go all the way through an interview process, you might still learn from the experience and come out with a few new connections!
Finally, I wanted to quickly touch on a topic that does come up with such advice: aren't you just wasting other people's time by interviewing "for practice"? My main counter-argument here is that it is the company's job to ensure they are spending their time wisely with regards to hiring. For all you know, you might end up changing jobs if the final offer is attractive enough.
And with that, let me dust off my resume and start applying!