In our urban environment there are 4 ways you will encounter bees:
Bees leave the hive to forage for pollen to take back to the hive. They are generally easy going at this time.
When a hive is too crowded 1/3 to 1/2 of the hive will take the queen and leave. This is swarming, they will be like this until they move into their permanent home. They are very docile in a swarm, they get defensive when they establish their permanent hive.
Commercial Beekeepers transport their hives to different crops throughout the year.
When a hive swarms, they will find an area they like and start building their hive, often in areas we humans don't like them. In defense of their new home, they will be more aggressive.