Documentation or explanation for keyword 'in' as used in function arguments

I am learning Swift and trying to find information about what the keyword 'in' does when used in a function argument as in these examples:

func fillEllipse(in rect: CGRect)
func drawSomething(in rect: CGRect, in context: CGContext, 
                   with colorSpace: CGColorSpace?)

From the context, I gather that it essentially means put the ellipse in a rectangle, draw something in a rectangle, in a context, etc. but what is actually happening when 'in' is used like this? Is it related to closures, or something else?

In Xcode, option-click on 'in' doesn't provide any information, and I haven't been able to find any explanations of this usage on the internet.