help with godot physics

This is a script for a ball that bounces on the floor

func _physics_process(delta: float) → void:

velocity.y += gravity
var collision: KinematicCollision2D = move_and_collide(velocity * delta)
if collision:
	var reflect = collision.get_remainder().bounce(collision.get_normal())
	print(reflect)
	velocity = velocity.bounce(collision.get_normal()) 
	move_and_collide(reflect)

However, I have no idea how the bounce() function and the get_remainder() functions work and what exactly they return. I would appreciate if someone broke this down into simple terms so I can understand.

get_remainder() returns the remaining motions vector, representing the movement that would happen in the current frame from the collision point onward, if collision didn’t happen.

bounce() changes the direction of a vector in the same way the direction of a ball changes when it bounces off the wall - it flips it around wall’s normal vector.