It executes on

  1. calls to the contract with no data (calldata)
    1. calls made via send() or transfer().

■ Features

To replicate the example above under 0.6.0, use the following code:

pragma solidity ^0.5.0;
contract Charity {
    receive() external payable {
        // React to receiving ether
    }
}

https://ethereum.stackexchange.com/questions/81994/what-is-the-receive-keyword-in-solidity