Do programs keep running on macos when user switches account?
Yes, the applications will continue to run in the background. This happens with Fast User Switching and when Locking then logging in.

Monitoring

You can see the other users' applications are running through the Activity Monitor application:


Applications > Utilities > Activity Monitor.app


To see other users' applications, select the menu item:


Activity Monitor.app > View (menu) > Other User Processes