This is an "apples and oranges" comparison. The US discetionary budget does not contain the things that must be paid, so leaves out social security payments and interest on the public debt for the US which are present in the China budget.
Social security in the United States is about 1200 billion, far larger than the military budget. Interest on the debt is about 305 billion.
US military hegemony/investment is unique, stemming from the mobilization of our manufacturing for WWII.