The background of the Alien and Sedition Acts starts with the undeclared war between the US and France in 1798, also sometimes called the Quasi-War. The United States owed France a financial debt from money borrowed in the American Revolution but refused to pay it once the French Revolution created a major regime change. The US position was that this debt was not owed to the new leaders in France. The Quasi-War was a shipping war on the seas and ended with a treaty in 1800.
Now, to the Alien and Sedition Acts. They were passed by Federalist president John Adams in 1798. They created a series of immigration and citizenship laws. The Federalists were opposed to adhering to old treaties with France and to sympathizing with the French and French immigrants. The Democratic-Republicans opposed the Federalists in these views. Thomas Jefferson was a Democratic-Republican. You can see some primary source materials about the Alien and Sedition Acts at the links below.