Under the hood, the software uses mathematics to solve the puzzle, and whoever solves the puzzle first, gets rewarded with Bitcoin.
On a less complicated level, you have a console miner, which you run from your PC, and before that, you add your wallet address into its config file.
Although much easier to understand than the mining code itself, console miners can be tech-savvy and can mine a single cryptocurrency at the time, which you choose.
However, in 2023(and for the last several years), we have the addition of GUI miners, which are rather easy to use.
Basically, the GUI miners pack the various console miners into their system and present them in a nice-looking desktop application environment.
Furthermore, they do monitor coin prices and can switch to a more profitable one at the moment, if that’s what you’d like to do.
So, I recommend GUI miners, because they can mine what’s most profitable at the moment(and exchange them for BTC or some other popular currency like ETH).
Also, GUI miners are the easiest to use, period.