The comparison M < 10 simply returns TRUE and FALSE values. When used as the indexes to subset a vector, TRUE mean "keep" and FALSE means "don't keep". Here is some code that might help explain that. Notice that the M vector here is not the same as in my previous post.
M <- sample(1:20,size = 20, replace = TRUE)
M
#> [1] 17 16 18 1 17 10 18 20 8 5 7 7 4 18 1 5 20 4 13 20
M < 10
#> [1] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE TRUE
#> [12] TRUE TRUE FALSE TRUE TRUE FALSE TRUE FALSE FALSE
Idx <- M < 10
M[Idx]
#> [1] 1 8 5 7 7 4 1 5 4
M[M < 10]
#> [1] 1 8 5 7 7 4 1 5 4
Created on 2020-02-08 by the reprex package (v0.2.1)