I have observed in a book that a light ray reflects during refraction, which is a partial reflection, but when does that occur? Is it related to the propagation of light from a greater to lesser refractive medium or from lesser to greater refractive medium?
Everything is about electromagnetic waves.
At the border of medium one of the components of electric field have to be continuus and other component of electric displacement field. Such calculations leads to Fresnel equations
I assume you ask if there is also reflection when refraction occurs. The answer is yes. It happen when light (or any kind of wave) passes from a medium 1 to another medium 2, those medium being characterized with different index (i.e. wave velocity).
At the interface between the two medium, in the case of light wave, the electric field has to obey certain boundary conditions, imposing what the field must be on one side of the interface and on the other side. The fields must be different because the index is different. Those condition lead to the fact that first the transmitted (refracted) wave goes through medium 2 with a different angle, but also that there must exist a reflected wave in medium 1, emerging from the interface at the same angle as the incident wave. Now from those boundary condition one can obtain transmission and reflection coefficient, telling you how much of the incident beam goes inside the material (refraction) and how much is reflected. Energy conservation (if non absorption is present) impose that what isn't refracted is reflected sot that the sum of the transmission and reflection coefficient equal to one.
To summarize, if there's a refracted beam, there will be a reflected beam (for a simple interface between dielectrics and neglecting absorption)
Recall that from energy and momentum conservation when the Snell's law is applicable, then R=0. But when R=1, then i=r.