Quick clarification - it is not that smart. Using the IPython display method to show such an object will always generate the HTML, regardless of what frontend is being used. In general, the kernel does not know what frontends will be displaying the information, so it cannot make such decisions.