Because if you were consuming 4000 calories of food and drink before and reduced it down to 3000 by drinking diet soda. It's still a lot, but less. Which is better.
Other things might influence to a degree, but the main problem is always going to be caloric in nature.