The interesting thing in terms of today's situation is that the Alien and Sedition Act was passed in response to the XYZ affair, in which French Foreign Minister Talleyrand demanded a $250,000 bribe from Adams before he would consider normalizing relations between France and the USA, which at the time were drifting perilously close to war.
The slogan "Millions for defense, not a cent for tribute" dates from that time.
It was anti-war, pro-French sentiment and activism from Republicans (Jeffersonians) that cause Federalist Adams to seek to shut them up with the Alien and Sedition Act.
Tish-tush! This act was rammed though a Federalist controlled congress by the High Federalists ('ulta-conservative")splinter group based out of New England.
Adams was a "regular" (moderate)Federalist but, hoping to hold the party together thereby increasing his chances of winning the up coming presidental election, and knowing there were enough votes in Congress to override his veto anyway, he resigned himself to the Act.