If someone were to pull the rug on which you are standing, what do you think is likely to happen? You will probably fall and hurt yourself, and in the process create problems for yourself. When someone pulls the rug from under your feet, what he is doing is taking away the support or help that you have been receiving. By taking away your support rather unexpectedly, he creates all kinds of problems for you.
Examples: Prabhu pulled the rug from under his children’s feet by denying them their allowance. * The company was losing money. It decided to pull the rug from under the ill-fated project.