If you hurt someone's feelings, you offend that person. You might accidentally offend your friend when you joke about the worst restaurant in town, not realizing it's her favorite place to eat.
If you do something that makes another person resent you, you offend them. Your friends might not mind because you're so humble, but it could offend other classmates when the teachers always pick you for awards and honors. You also offend when you cause disgust or distaste. After your week of camping — and not showering — your smell will probably offend the nose of anyone who has to sit near you.