There is a difference between using the startTime/endTime in the WHERE clause and the Global time frame in the USQL.
USQL Global timeframe filter in WebUI will match all user sessions that were active between from and to time.
That means it will match all user sessions that started and ended within the timeframe filter, all user sessions that started before the timeframe and ended within the timeframe, all user sessions that started within the timeframe and ended after the timeframe, and even all user sessions that started before the timeframe and ended after the timeframe
and when you use the endTime where clause this will match only sessions that have the last useraction timestamp within this timeframe added in the query
or
when you use the startTime where clause this will match only sessions that have the first useraction timestamp within this time frame added in the query

Example:
08:30 09:30
timeframe filter |-----------------------------------------------|
session 1 |----------|
session 2 |-------------------|
session 3 |---------|
session 4 |---------------------------------------------------------|
With Endtime (in the uSQL query):
SELECT COUNT(*) FROM usersession WHERE endTime > 1687422600000 AND endTime < 1687426200000
using the Where clause endTime count will be - 2 (session 1 and session 2)
Without Endtime (timeframe was set at the Global level 8:30 to 9:30 June 22)
SELECT COUNT(*) FROM usersession
using the Global time frame count will be - 4 (all 4 sessions)