by
The German word 'bei' is used to indicate location or proximity, similar to the English 'by' or 'at'. For example, 'Ich bin bei meiner Freundin' means 'I am at my friend's place'. However, 'bei' can also be used to indicate association or connection, as in 'bei der Arbeit' which means 'at work'.
I study at the university
The word 'bei' in this context is used to indicate the place where the action is happening, in this case, the university where the subject is studying.
I am at work
In this example, 'bei' is used to indicate the location where someone is. More precisely, at their place of work in this case.
We eat at my friend's house
Here, 'bei' is used to indicate that the action, which is eating, is happening at the location of a the person referenced, which is at 'my friend's house' in this particular phrase.