The lambda
A lambda expression writes a small function right where you need it. [limit] is the capture list, (int x) the parameters, and the braces hold the body. Lines 3 to 5 make an object, big, that you can call like a function.
Lines 1 and 2 make two local variables in main: a vector v holding 3, 8, 1, 9, and an int limit holding 5. The lambda will answer one question about each element: is it bigger than limit?
Capture
When line 3 runs, the lambda expression builds the closure object big. [limit] copies limit's value at that moment, 5, into big. From now on big has its own 5, separate from main's limit.
The compiler invents a class with no name you can use: the closure type. Each copied variable becomes a data member, and the body becomes its operator(), marked const. big is one object of that class, like any other object.
Line 6 sets main's limit to 100. big does not notice: it holds its own copy, still 5. A copy capture is a snapshot taken when the lambda expression ran, not a live link.
Calling it
std::count_if takes a range, v.begin() to v.end(), and a predicate: something it can call with one element that answers true or false. big is passed like any object, by value, so count_if gets its own copy of big.
count_if calls big once for each element and counts the trues. 3 > 5, 8 > 5, 1 > 5, 9 > 5: two are true, so n is 2. Every call compares with big's copy, 5, not with main's 100.
Choices
Write [&limit] and big copies nothing: it refers to main's limit itself. Each call now reads the current value, 100, so no element is bigger and n is 0. Same code, one character more, a different answer.
A reference is only safe while the variable lives. If big were returned from a function or stored for later, limit would be gone and calling big would be undefined behaviour. Refer for lambdas used on the spot; copy for ones that outlive the scope.
Since C++14 a parameter can be auto: [](auto a, auto b) { return a < b; }. Then the closure's operator() is a template, so one lambda works for ints, doubles or strings. Lambdas are how you hand behaviour to std::sort, std::find_if and friends.
What happens
;; step 1/10 · what
[ captures ] ( parameters ) { body }
[limit] what the lambda may use from around it
(int x) what it takes when called
{ return x > limit; } what it does
auto big = ...; big holds the result: an object
big(7) calls it like a function → true (7 > 5)
The closure type has no name you can write, and the C++ standard leaves its copied members unnamed too. The class Big in the notes is a model that behaves the same way; it is not literally what the compiler writes. The card shows the body of main. The full program adds #include <algorithm>, <iostream> and <vector>, and prints n with std::cout. Built with g++ or clang++ -std=c++20 -Wall -Wextra it prints 2; with [&limit] on line 3 it prints 0.