Yeah but it can be really much more simplified.
As nabismo said, there’s a standard called “Semantic Versioning” that defines what each part means and when they should change based on what’s included in each release.
Oh! So its a standard! Okay okay!
The idea is that the x.0.0 is the start of a new, backward-incompatible feature-/function-set, while the numbers after '.' have less impact. Some schemes have this system with a possible '-2', to indicate the 2nd revision for e.g. packaging the same version of the software. It has become fairly standard although it differs how strict the meaning of the positions is respected.
Yee. It’s described well here: https://semver.org/ You can take it a step further by using what are called “conventional commits” where your git commit message contains the scope of the changed code. Then a GitHub Action can automatically make the version changes that reflect your code changes. My Nostr relay implementation, Memorelay, works this way.