What does “as” represent for in “Cantor quits as Majority leader” and “Cantor to resign as Majority leader”?
OED s.v. “as” sense 11:
a. Introducing a noun phrase equivalent to a subject or object complement.
(a) In the character, capacity, or function of.
. . .
(b) In theatrical and related use: in the role of.
Mr. Cantor is not resigning his seat in the U.S. House of Representatives, his term having not yet expired, but he is vacating his leadership position within the Republican party majority in that chamber.
"As" is a preposition linking Cantor to his role.
"As" can be a preposition, adverb, or conjunction. When used as a preposition, "as" has two uses: introducing a basis of comparison, or "in the role of" as @Brian Donovan has already answered.
It wouldn't be correct to use "from" instead of "as" here. "Cantor resigns from majority leader" wouldn't make sense, Perhaps an example involving another famous Republican might help to illustrate:
Richard Nixon resigns as President
Richard Nixon resigns from the Presidency