As with its Windows counterpart, the Java installer selects the option to install the Ask app by default. A casual Mac user who simply clicks through the dialog boxes to complete the installation will find the app installed and enabled in their browser, with the New Tab page changed to one with an Ask search box.
Here’s more details on how it works:
For the purposes of Gatekeeper, Apple verifies the identity of the developer, but not their intent. It’s up to you to ensure that the applications you install and run on your Mac come from the people you think they came from, and we’ll show you how to do that.