When you invite a friend to do something, you request her company, or encourage her to come with you. You might invite a group of neighbors to help you throw a block party.
You could invite your friend to join you on a road trip, or invite your parents to your art show at a local gallery. You're making a polite request. Similarly, a newspaper might invite readers' comments, or a school might invite ideas for how to spend grant money. Invite is also casual shorthand for "invitation." When you tempt someone to react, you also invite that reaction: "Your strange film really invites harsh criticism."