SVMs work by finding the optimal hyperplane that best separates the data into different classes. For two-dimensional data, this hyperplane is simply a line. In the context of cancer, this could mean separating benign cells from malignant ones. The algorithm tries to maximize the margin between the hyperplane and the nearest data points from each class, which are known as support vectors. This maximization makes SVMs highly effective and robust.