The OpAmp compares the voltage at the input terminals and multiplies the difference by a very high gain to generate the output. This is why when the sinusoidal input is positive, the output of the OpAmp is high and when the sine is negative the output is low. The output is a square wave with a large slope on the rising and falling edge. The slope on the edges is from the 100 kV/V gain multiplying the small difference in voltage when the sine goes from negative to positive or positive to negative. Increasing the OpAmp gain will make the slope steeper on the rising and falling edges.