6.0 marshmallow – Is the “Cast” functionality Miracast or Chromecast?

When I go to Settings -> Display -> Cast, check “Enable wireless display” (no idea why I have to do that) and connect to a display, will it use Chromecast protocol (over Wifi) or will it use Miracast protocol (separate direct Wifi connection)?

Or does it support both and chooses depending on the receiver? Then let’s assume the receiver is a Chromecast.