In the comments, some have noted difficulty finding official sources. I've found this, at https://travel.state.gov/content/visas/en/visit/visa-waiver-program.html:
Trips to Canada, Mexico, or nearby Islands
If you are admitted to the United States under the VWP, you may take a short trip to Canada, Mexico, or a nearby island and generally be readmitted to the United States under the VWP for the remainder of the original 90 days granted upon your initial arrival in the United States. Therefore, the length of time of your total stay, including the short trip, must be 90 days or less. See the CBP website. Citizens of VWP countries* who reside in Mexico, Canada, or a nearby island are generally exempted from the requirement to show onward travel to another country* when entering the United States. Learn more on the CBP website.
I infer from this that if you enter the US on the visa waiver program and then go to Canada within 90 days:
If you return to the US within the 90-day period, you will get somewhat less scrutiny from the border officer, at least because you are being considered for admission for a shorter period.
If you return after your 90-day period has elapsed, you will enter with a new 90-day period. You will get as much scrutiny from the border officer as you would if you were entering from any other country. If not much time has elapsed since your 90-day period expired, the officer will consider whether you're trying to game the system. This is true whether you're entering from Canada or from any other country.
If you don't return to the US, there's no problem whatsoever.
The "CBP website" links point to http://www.cbp.gov/travel/international-visitors/frequently-asked-questions-about-visa-waiver-program-vwp-and-electronic-system-travel. There's nothing on that page about short trips to neighboring countries, however.