For search functions, users have a habit of generally liking to click their mouse on the search box in order to place the cursor there before typing in keywords to search. If the cursor is set by default to the search box, it will undoubtedly save the user time moving the mouse. Regarding the positioning of the cursor in the search box, take a look at the two pictures below: