My guess is that at some point in the past there was a second switch there, which was connected to those wires in the black tape. Maybe there is a light that is currently controlled by one switch, but previously it was also controlled by a second switch here?
Be sure to turn the power off...