In this news story the UK government has been fined £500,000 but who is doing the fining? Is the government fining itself?
Expanding on @Rick's answer, the UK government does not hold all of its money in an undifferentiated general fund (although much of it is held that way). In non-profits and government, one generally uses "fund accounting", in which particular pots of money can only be used for particular purposes and the government keeps track of how much money is held in each fund.
In this case, credit in a fund for cabinet operations would be transferred to a fund for privacy violation fines whose disposition would be set forth either in the Data Protection Act (2018) itself, or in some other piece of legislation (perhaps statutes on court administration) setting forth how funds collected as fines are used.
This said, the intuition of the question isn't wrong.
When one part of the government fines another part of the government, especially if the fine has the impact of preventing the fined part of the government from carrying on necessary governmental operations, the economic effort of the fine can be swiftly wiped out in the next annual appropriations bill, or in an interim emergency appropriations bill, if necessary. And, if the individual offenders who committed the violations aren't penalized, this may not be a very effective incentive to bring about compliance with the law.
Of course, even if the economic incentive that the fine creates to comply is negligible, this doesn't mean that the symbolic and political cost of holding a government agency accountable in the same way that a private firm would be held accountable, that indicates the magnitude of the wrong done, is meaningless for the politicians running that agency.