So, firstly, there are a number of antivirals. For some diseases — HIV and hepatitis being great examples — these are extremely effective and can sometimes completely cure the disease. However, they also tend to be extremely expensive to design and make, so they are not widely used and the most common one for influenza — tamiflu — has moderate efficacy and is usually saved for pandemic-type situations to prevent overuse.
In terms of how the vaccine works, essentially it is priming your immune system to fight the disease. After getting the vaccine your immune system recognizes the virus, and can more easily fight it off when you get infected. And since you are less likely to get the disease, you are also less likely to infect others — this is what’s known as herd immunity. For a more in-depth explanation of herd immunity, here’s a piece I wrote that explains it much better.