How do games handle scripted animations?

Sorry if this has been asked a million times before. I’m wondering how other games transition from gameplay like a state machine to scripted animations. Level sequence? Something with blueprints? I really have no clue and can’t find much online right now, so any pointers would be really helpful. Thank you!