Why it might be illegal to show Game of Thrones at your local bar

Is it legal to broadcast HBO in your bar? Or Netflix? Or the World Series? Surprisingly, it depends.