Database sharding involves horizontally partitioning a database table across multiple servers to improve scalability and performance. Cassandra is a distributed database that supports automatic sharding of data and replication across nodes using consistent hashing. Consistent hashing maps keys and nodes to an abstract hash ring and assigns keys to nodes clockwise on the ring to minimize data movement when nodes are added or removed. This allows Cassandra databases to seamlessly scale without performance impacts.