It's pretty obvious that it's foreign investment fueling this. Canada is ground zero for international money laundering. Chinese and others are taking dirty money from overseas and investing it in Canadian real estate.
The other side of the coin is extremely low interest rates which allow locals to purchase properties they probably can't afford (prices pushed up due to foreign investment). There is no longer any connection between economic fundamentals and housing prices in Toronto & Vancouver.
This situation could persist for years. However, I certainly don't have a lot of confidence in a market fueled by overseas investors, especially given that it doesn't even make sense how Chinese can buy here considering the restrictions on removing capital from China.