If an out-of-bounds index is passed to iloc, it raises an IndexError. However, if a slice with an out-of-bounds index is used, iloc will return values up to the maximum available index without raising an error.