It's distributed to all member states in the proportion that they contribute to the EU budget, after all appeals are completed.
If you fully follow the money, it's mostly used to make local EU agricultural products cheaper, and for the government offices and jobs in Brussels and Strasbourg.