Antibiotics take their effect on bacteria, precisely on their metabolism. To understand why they work on bacteria but not on viruses you must first understand the basics of how each parasite behaves, is structured and, affects the infected individual. Bacteria use ribosomes to synthesize proteins some antibiotics inhibit protein synthesis, therefore the bacteria is killed. Bacteria can evolve into becoming resistant to antibiotics by synthesizing an inactivator enzyme that cancels the effect of the antibiotic. Most bacteria affect people by releasing toxins. Viruses don't have a metabolism, one of the main reasons why they're not considered living things. They use the guest to replicate by inserting their genetic material DNA(adenoviruses) or RNA(riboviruses) inside the cell. They use the cell to multiply. Viruses are made of the mentioned genetic material(RNA or DNA) and a capsid(a capsule that encloses the genetic material). It affects the sick person by multiplying inside cells so many times, eventually making them burst, releasing thousands of viruses and, by causing an immune reaction.
To summarize antibiotics work on bacteria and not on viruses because bacteria have a metabolism that can be inhibited and viruses don't.