the groups or lack of groups for summarise to process will always be determined by the presence or absence of prior group_by statements on the dataframe passed to summarise.
If you are getting the 'wrong' groupings then you should investigate your use or lack of use of group_by().
That said, the messaging and the final grouping behaviour of summarise (by which is meant the group_by settings on the summarised dataframe can be easiliy controled with .groups , as the information message advised you. here is an example you can look at.
iris dataset has 150 records, 50 for each species
library(tidyverse)
iris %>% summarise(n=n())
iris %>% group_by(Species) %>% summarise(n=n())
iris %>% group_by(Species) %>% summarise(n=n(), .groups = "keep")
iris %>% group_by(Species) %>% summarise(n=n(), .groups = "drop")
iris %>% group_by(Species) %>% summarise(n=n(), .groups = "drop_last")
iris %>% group_by(Species) %>% summarise(n=n(), .groups = "rowwise")