Lots of people are running full nodes that are not used for mining, not using a bitcoin core wallet with it, and not using an SPV wallet linked directly to that node. In other words it is a network node (is there another name for this?) that validates transactions and validates blocks, and interacts with other network and non-network nodes.
Are these needed? How do they improve overall security of bitcoin? I'm really asking here, not really sure one way or the other what effect they have.
Those nodes further verify and validate transactions and blocks. It reduces the likelihood of a few people colluding and spreading around bad blocks and invalid transactions. Also, they do verifying and validating of the blocks that miners produce since a lot of miners don't actually run full nodes, they use SPV mining which does not validate the blocks. Supposedly SPV mining is faster and reduces orphan blocks.
If we had no network nodes and only mining nodes and nodes directly connected to wallets would bitcoin be less safe, more safe or the same? Like we might end up with just 100 nodes or something (1 for each large mining pool, a few for the large bitcoin service providers like coinbase, etc, and a bunch for people using their nodes with the bitcoin core wallet, and a handful of SPV users. Maybe 100 is a bit too small a number (what would the number be?).
It would be less safe. Less nodes means that a few individuals could collude and force the blockchain to go in a certain manner. They could introduce checkpoints that essentially fork the blockchain, and SPV nodes would have to follow them and trust that they are correct, even though they may not be. More nodes reduces the likelihood of that. More nodes are also a lot harder to DDoS. If an attacker were to DDoS a network with only a few nodes, he could do a lot of damage and essentially shut the whole thing down. With more nodes spread out over the earth, it becomes much harder to do that. More nodes everywhere also prevents governments from being able to seize nodes and shutdown the network as they will be people operating nodes outside of those governments jurisdictions.