
Rebecca P. answered 09/25/21
Nurturing Artistic Creativity through Violin and Ukulele Lessons
I believe what you're referring to is Phrase Modulation, modulation in which one phrase ends with a cadence in the original key, and the next phrase begins in the destination key without any transition material linking the two keys. You'll learn about it in music theory when you begin harmonic analysis.
Like the last answer said, this is very common in classical music and it's used in almost every type of music. (I do think that often it is emphasized in pop music in a jarring way, and I wonder if that's what you're referring to!)