The algorithm is explained in the documentation. "By default, an outlier is a value that is more than three scaled median absolute deviations (MAD) away from the median". The link provides a relatively simple equation showing how the MAD are calculated.
The reason the outlier at y=64 is not identified when the number of values increase is because your median changes and 64 is no longer 3xMAD.
There are other methods you could try. Outlier detection is not trivial and there's no sure-fire way that detects all outliers in all situations. Even the definition of what constitutes an outlier is subjective in many cases.
If all of your outliers are large, positive spikes like in your example, you could simply set a threshold that is n standard deviations from the mean and any data points beyond that value can be considered outliers.