It means someone is going to give someone else a hard spanking probably using a belt or strap. The phrase was used to indicate strong punishment by an authority figure over a child.
An individual who is so stupid that you could be forgiven for wondering whether they have any brains in their head at all. A total idiot, an imbecile someone who you can’t imagine how they are even functioning.