how does the program change the clock speed of the processor? bios is a program that checks all devices and starts the bootloader.
but how does the CPU sync with the motherboard if the CPU clock settings are stored in the BIOS?

Does the BIOS have CPU clock frequency settings?
how does the BIOS adjust the clock speed of the processor if it's just a program?
does the BIOS synchronize the internal clock of the processor with the external clock on the motherboard?
does the processor first start on the external clock, and after synchronization - on its own internal clock frequency?
does the change in the CPU clock speed mean its own internal clock due to heating problems (throttling)?
How can the operating system change the clock speed of the processor? does it really change the cpu settings or put some limits on the task scheduler? (Are Linux and Windows the same with this?)

I am completely confused about how the processor actually syncs at startup and sets the clock speed?
please explain me.
answer as processor clock = base clock * multiplier. I do not understand
This is different for any processor. You should consider going to the Intel, ARM and AMD websites and looking for the right manuals. That’s what I would do if I had to answer the question, and that’s what I recommend you should do.