Parts of this episode were filmed in Los Angeles, because they involve a live actor-bear (named Little Bart), and there are various legal restrictions on international transport of large animals such as bears.
The episode title refers to humorous ribald song popular in Westeros, about hairy bear that while going to a fair with a band of three boys and a goat, rescues a maiden who was hoping for a knight. It also refers to Brienne's fight against the bear, during which Locke and his men sing mockingly the song while watching it.
The trivia item below may give away important plot points.
In the novels, it is only implied that Ramsay castrated Theon. However, many fans have seen this episode as a confirmation of those hints, since George R.R. Martin wrote this episode which openly depicts Theon's castration.