ByteDance interview question

How do threads work in programming?