How do you like them apples?
You're barking up the wrong tree if you're expect me to explain the origin of that phrase. Don't be discouraged though, because we're about to drop the hammer, push the envelope and fly by the seat of our pants towards the origin of some other fantastic phrases.
Most of the codswallop we hear now-a-days formed many years ago when dogs had a reason for barking up the wrong tree and going off half-cocked certainly didn't sound as odd as it does now.
Phrases, such as "raining cats and dogs", or even getting fired came from further back when daily life was a very different kettle of fish. Many more whacky phrases have a basis in religion and were used to ward off spirits or display a faith in Christianity.
Other sayings that have made their way into our everyday vocabulary were only coined over the last hundred years or so - such as "It's not over till it's over", coming from famous people who just happened to have a knack for saying memorable things or even from television shows.
And who knows, in 3007 there may be a blog post just like this one trying to explain why, "that's hot", "that's cool" and "that's wicked" can somehow all mean the same thing.
Wouldn't that just be the cat's pyjamas?
Chris