It’s both working together- the basic research, including identifying targets and new chemistry and in some cases even the drugs themselves are mostly academia. However, clinical trials, and drug development that iterates the chemical structure itself and delivery approaches is very expensive, and almost entirely done by industry. Often the academics are working collaboratively with pharmaceutical- and can have either government or pharmaceutical funding for these projects. I’m an academic PI that has discovered and patented new drugs and licensed them to industry.