There is a history behind the idioms we use in everyday life. They have been around as early as the 19th century. People often wonder where the idioms, "barking up the wrong tree", "costs an arm and a leg", and "knock on wood" came from. These idioms should not be taken literally. Idioms will be passed on for generations to come based on their history, out of habit, and just for the fun of it.
Although the origin of "costs an arm and a leg" is unclear there are a few possible theories as to when it originated. Some say it originated from the early 20th century, possibly during one of the major World Wars. It states that soldiers, because of their heavy involvement in war and being in the line of fire, can sometimes lose a hand, foot, leg, or arm. Thus, the war literally cost the person their arm or leg, which was certainly a high price to pay. The earliest recording found was in the mid-20th century and it says, "it cost them an arm and a leg to fix up a rumpus room for junior!" So if a person thinks the cost of something is unreasonably high, they might use this phrase. In addition to this there is "barking up the wrong tree" and "knock on wood", that are very interesting.
If someone was making a wrong assumption about something, it might be said that they were "barking up the wrong tree." The origin of this phrase is believed to be rooted in dogs and hunting. Dogs are often used during hunting because of their strong sense of smell, their ability to chase and track other animals, and they add a bit of extra security for the hunter. Once the dog spots another animal they will likely give chase. Thus sending the fleeing animal, if it is capable, to climb a tree in order to get away. Since dogs are not great at climbing trees, they will instead remain at the trunk of the tree and bark, which gives the hunter an indication on where the fleeing animal went.