Not all medicine needs to be taken on an empty stomach. Some however, like the kind you are obviously referring to require something already in the stomach to help aid in the absorption of the medicine or to help protect the lining of the stomach from irritation caused by properties in the medicine.
Some medications need to be absorbed gradually, so if you take it without any food in there it will get absorbed all at once, and leave your system all at once. Having the food there to mix it with ensures that it gets absorbed little by little. Also, some meds are harsh on your stomach, and taking them without food as a buffer can cause pain and sometimes ulcers. Usually it has more to do with the absorption rate though.
Some meds. are rougher on the stomach lining, causing pain, or being sent back up. So by eating you're essentially blocking the meds from irritating your stomach, and the acids are doing their thing already by the time the pill hits your stomach, many can just be taking with a nice milk coating and many you can take without worrying about eatting
The medicine won't work then it will actually make you feel more sick then u were because you didn't eat any food and you're not getting the nutrients you need from it and the food actually helps u and the taste won't be as bad if u eat the food with it or before it!