From the documentation:
For bootstrap samples, simple random sampling is used.
For other data splitting, the random sampling is done within the levels of y when y is a factor in an attempt to balance the class distributions within the splits.
For numeric y, the sample is split into groups sections based on percentiles and sampling is done within these subgroups.
For createDataPartition, the number of percentiles is set via the groups argument.
I don't understand why this "balance" thing is needed. I think I understand it superficially, but any additional insight would be really helpful.