Palantir builds analytics, tools to better use and interpret the data that the government already has. The data collection, the actual surveillance, is done by the government.
Palantir started with analytics because the founders believed the US was making poor use of data, and needed better tools.