I thought government couldn’t do anything well ?
It still doesn't.
If politics invaded DARPA, the way they have invaded every other federal agency, and micromanaged research oblivious to the "scientific method," (e.g. Global Warming) we would still be communicating using flags.
This particular branch of government, DARPA, has figured out how to set goals and then incentivize the private sector to achieve them. With guidance from the private sector DARPA figures out what needs to be done. Then they allocate funding and dole it out to private companies. Most importantly, unlike most military procurement, they tell companies WHAT they want, but NOT how to achieve it. Money is given not to favored congressional districts but to the best researchers with the best proposals.
It can’t. Which is why some of these projects get fed billions of dollars over decades instead of millions over years.