Why would a central bank buy government bonds? E.g. the Bank of Japan buying Japanese government bonds.
Because this is how the "government issues new money" in the era of (quasi) independent central banks: instead of directly issuing new money, the government in the narrow sense borrows from the central bank (which has been awarded the "printing privilege") so this new money is recorded as debt burdening the government (plus interest), which then is accountable for this debt burden and how it affects the balance of public finances.