Ant-Man was a superhero movie in another genre
Screenwriter Edgar Wright said in an interview that he wanted to do a cross-genre film that was not a typical science-based superhero film, but instead was in a different genre.
Ant-Man was basically doing a superhero film in invert commas, and it takes place in another genre, almost more in the crime-action genre, that just happens to involve an amazing suit with this piece of hardware. The thing I like about Ant-Man is that it’s not like a secret power, there’s no supernatural element or it’s not a genetic thing. There’s no gamma rays. It’s just like the suit and the gas, so in that sense, it really appealed to me in terms that we could do something high-concept, really visual, cross-genre, sort of an action and special effects bonanza, but funny as well.
…and the screenwriter just wanted to make a film about a character he loved
Movies aren't always created because of what they can add to a franchise. Sometimes they are just created because people want them to exist.
Edgar Wright was given a list of possible comic book titles to write a movie for and chose Ant-Man because he had fond memories of reading about the character.
[The studio executives] said, “Are you interested in any of these titles?” The one that jumped out was “Ant-Man” because I had the John Byrne “Marvel Premiere” from 1979 that David Micheline had done with Scott Lang that was kind of an origin story. I always loved the artwork, so when I saw that, it just immediately set bells going off kind of thinking going “Huh, that could be interesting. ”
This was also why Scott Lang was chosen as the titular Ant-Man instead of Hank Pym, the first hero to don the mantle in the comics (see Why was Scott Lang chosen as Ant-Man over Hank Pym and Eric O'Grady for more info).
Black Panther provided a third perspective to contrast Iron Man and Captain America
Kevin Feige, producer of Captain America: Civil War, said in an interview that they wanted someone who wasn't an Avenger and who could provide a different point of view from Iron Man or Captain America. Black Panther seemed like a natural choice.
“The reason we introduced him in Civil War is because we needed a third party. We needed fresh eyes who wasn’t embedded with the Avengers and who has a very different point of view than either Tony or Steve. We said, ‘We need somebody like Black Panther… why don’t we just use Black Panther?’ That’s how it went in the development process.”
Black Panther is a superhero who sees himself as a politician
Ryan Coogler, director of the 2018 Black Panther movie, said in an interview that T'Challa considers himself to be a politician, rather than a superhero.
What’s so great about Panther is he’s a superhero who, if you grab him and ask him if he’s a superhero, he’ll tell you, ‘No.’ He sees himself as a politician, as a leader in his country. It just so happens that the country is a warrior-based nation where the leaders have to be warriors, as well, so sometimes he has to go fight. I think starting at that is really so interesting.
…and a Black Panther movie has been in the works since 1992
Long before the Marvel Cinematic Universe was a thing, a Black Panther film had been trying to get off the ground. The June 21, 1992 issue of The Boston Globe first announced that Wesley Snipes had been trying to make a film about the character (can't find the text of this online unfortunately). Stan Lee eventually joined the project, but the film stalled because he was not happy with any of the scripts.
People have tried to make a Black Panther film for over 25 years. I suspect it would have gotten made whether it brought anything new to the Marvel Cinematic Universe or not.