On a modern system, a partition device will only appear if the partition actually exists.
On a disk with an MBR partition table, partition numbers 1 through 4 correspond to the four slots in the partition table, called "primary" partitions. They don't have to be filled sequentially, so it's possible, for example, to have an sda2 but no sda1. Partition numbers 5 and up correspond to "logical drives" in an extended partition, and those are always numbered sequentially, so you can't have an sda6 without having an sda5 too.
On a disk with a GPT partition table, there can be many more (typically up to 128) partitions, and all are "primary". So you could have a disk whose only partition is sda9, for example.
If the disk has no partition table, then it'll have no partition devices, of course.
Older systems — those using a static /dev rather than one managed by udev — will typically have device nodes for all the possible partition numbers, regardless of whether the partitions actually exist. (Trying to open the device file for a nonexistent partition will fail, of course.)
It's possible to forego partitioning and put a filesystem directly on a disk. When you mount a block device, the filesystem driver typically looks for a superblock at a predetermined offset from the beginning of the device, and since the beginning of a partition is not the beginning of the disk itself, the superblock for a filesystem in a partition is located at a different place on the disk than the superblock for a filesystem created on the "whole-disk" device.
So if the disk used to just have a filesystem, and then it was partitioned and a filesystem was created in a partition, the old superblock might still be there, e.g. in the small gap before the beginning of the first partition. So the disk still appears to have a filesystem on both the raw disk device and on the partition device, because whichever one you try to mount, when the filesystem driver goes looking for the superblock it'll find one.
It's not actually safe to mount and use both filesystems, though, since they overlap on the disk. One may have important bookkeeping data in what the other thinks is free space. That's why it's a good idea to zero the beginning of a block device, to remove any unwanted superblocks, when you want to change a raw disk to a partitioned one, or vice versa, or change the type of filesystem used on a partition, etc.