In regard to the comment by ohwilleke, the House Speaker's chair is vacated every 2 years without any sort of motion to vacate because a new Congress begins when members of the House are sworn in during January of the year following the House elections held every 2 years in each even-numbered year. House members serve two-year terms which coincide with the two-year duration of a Congress, which is why you may have heard references to the 118th Congress — the current one that began in 2023. Each Congress has two sessions, the first session convened when those individuals who won the previous year's November election in their congressional district are sworn in during
January, and the second session is similarly convened in January of the following even-numbered year.
Members of the House remain the same from the first session to the second session of a Congress with rare exceptions, such as when Rep. George Santos was expelled last year, or when a member of the House resigns for whatever reason before their two-year term ends. Thus, half the elections for seats in the U.S. House of Representatives coincide with our presidential elections held every four years, and the other half are part of the mid-terms. And the individual elected Speaker of the House at the beginning of a new Congress serves in that post throughout that Congress unless they choose to resign or their chair's vacated (the latter of which has been an extremely rare occurrence until this Congress when Republicans became the majority in the House). But a new speaker is elected at the start of each Congress, although it often ends up being the same individual who held that position in the prior Congress if members of their party's caucus still support them. That's why Rep. Nancy Pelosi was Speaker of the House for many years because her party maintained a majority in the House during each Congress in which she served, and its members voted to reelect her speaker. It wasn't like she kept that position automatically.
All this is why what ohwilleke commented is incorrect. The office of Speaker of the House is automatically vacated at the end of each two-year Congress because that's how it works. There's no such thing as the speakership being vacated deliberately through a motion to vacate if the mid-terms change which party has a majority in the House because it happens automatically. Hypothetically, members of the House when there's a Democratic majority could elect a Republican speaker or vice versa, although I've never heard of that happening because why would they?
And to finish this discussion so everyone understands the situation in both chambers of Congress, 1/3 of the members of the U.S Senate are elected every two years, because their terms last six years and those terms are staggered. This still means all U.S. senators are elected in November of even-numbered years at the same time as a presidential election or a mid-term election. I think this is a little hard to wrap your brain around at first, but it's not hard to understand if you consider the fact that there are no federal elections elections held in odd-numbered years, except occasionally in the case of runoffs or special elections.
I hope that I've addressed some rather complicated matters in a manner that's understandable by everyone who's reading this. And I'd like to note that I do not mean to talk down to anyone who may already have known all this. But it's been my experience in talking to people over many decades — as I'm 64 years old and will celebrate my 65th birthday in September — that many Americans don't understand how the U.S. Congress works, and knowing about things like those I've discussed in this comment is a good start. Thanks for listening!