Why is the number of units the same before and after matching? I have a dataset (lalonde) with 429 controls and 185 treatments in sum 614 rows. Doing a propoensity score matching using the 1:1 NN (nearest neighbor method gives me the expected matched data with 185 treatments and 185 controls.
But when I use the estimated with probit regression method the matched data (described with "614 matched") still has 429 controls and 185 treatments.
Why?
I tried to follow the very good "tutorial" about the R package MatchIT using the lalonde dataset. That is the result using the estimated with probit regression.
A matchit object
 - method: Optimal full matching
 - distance: Propensity score
             - estimated with probit regression
 - number of obs.: 614 (original), 614 (matched)
 - target estimand: ATT
 - covariates: age, educ, race, married, nodegree, re74, re75

What I don't understand is that the resulting (matched?) dataset has the same number of controls and treatments. Why is that so?
The result is valid because it is the same as in the linked example. My question is not about the code. The code is just for providing example data and output.
How can 429 controls and 185 treatments become 614 matched? 614 is the sum. But with whom was it matched? There is not enough data in one of that groups to match 614.
Here is a minimal working example.
# see: https://cran.r-project.org/web/packages/MatchIt/vignettes/MatchIt.html

library("MatchIt")
data("lalonde")

# Full matching on a probit PS
m.out2 <- matchit(
    treat ~ age + educ + race + married + nodegree + re74 + re75,
    data = lalonde,
    method = "full",
    distance = "glm",
    link = "probit"
)
m.out2

m.data2 <- match.data(m.out2)

table(lalonde$treat)
table(m.data2$treat)

The output from the last two lines
> table(lalonde$treat)

  0   1 
429 185 
> table(m.data2$treat)

  0   1 
429 185 


The matchit() output provides a brief summary of the result of the matching. In the line
- number of obs.: 614 (original), 614 (matched)

the first number refers to the sample size prior to matching (i.e., in the "original" dataset), and the second number refers to the sample size after matching (i.e., in the "matched" dataset). It doesn't mean 614 units have been matched to some other units; it means after matching, 614 units remain.
Why is there the same number of units before and after matching? Not all matching methods drop units. Matching doesn't just refer to 1:1 pair matching, where each treated unit receives a matched control and any unmatched units are dropped; it refers to any method of subset selection or stratification that is used to create balanced treatment groups. For an introduction to the variety of matching methods, see Stuart (2010), Greifer and Stuart (2021), or the MatchIt vignette on matching methods.
The method implemented by the code you include is called (optimal) full matching. The "full" in "full matching" refers to the fact that the full sample is used and no units are dropped. Full matching involves carving up the sample into subclasses that each contain exactly one treated unit or exactly one control unit, and the subclasses are formed in such a way as to minimize the distance between units in each subclass. The subclasses are used to form stratification weights, which, when applied to the sample, yield covariate balance. The stratification weights are a nonparametric version of inverse probability weights and have the same interpretation and use. Because full matching does not drop any units, the size of the sample before and after matching will be the same. (Note that it is possible to drop units in full matching by performing a common support restriction or adding a caliper or exact matching restriction.) See Stuart and Green (2008) for a nice introduction to full matching. It is also described in Hansen (2004) and Austin and Stuart (2015).
Although full matching retains all units, that doesn't mean you get the same precision after full matching as if you had not done the matching. The information contained in the weighted sample (i.e., weighted by stratification weights resulting from full matching) is less than the information contained in the unweighted sample because some units are up-weighted and others down-weighted, which adds variability to the effect estimate, leading to imprecision. The degree of the loss of information imposed by the weights is measured in a number called the "effective sample size" (ESS), which is returned when using summary() on the output of a call to matchit(). This number is a better representation of the "size" of the remaining sample after matching, especially with methods that retain the full sample. I briefly describe the ESS here, and you can read about a related measure in Shook-Sa and Hudgens (2020).

Austin, P. C., & Stuart, E. A. (2015). Optimal full matching for survival outcomes: A method that merits more widespread use. Statistics in Medicine, 34(30), 3949–3967. https://doi.org/10.1002/sim.6602
Greifer, N., & Stuart, E. A. (2021). Matching Methods for Confounder Adjustment: An Addition to the Epidemiologist’s Toolbox. Epidemiologic Reviews, mxab003. https://doi.org/10.1093/epirev/mxab003
Hansen, B. B. (2004). Full Matching in an Observational Study of Coaching for the SAT. Journal of the American Statistical Association, 99(467), 609–618. https://doi.org/10.1198/016214504000000647
Shook‐Sa, B. E., & Hudgens, M. G. (2020). Power and sample size for observational studies of point exposure effects. Biometrics, biom.13405. https://doi.org/10.1111/biom.13405
Stuart, E. A., & Green, K. M. (2008). Using full matching to estimate causal effects in nonexperimental studies: Examining the relationship between adolescent marijuana use and adult outcomes. Developmental Psychology, 44(2), 395–406. https://doi.org/10.1037/0012-1649.44.2.395
Stuart, E. A. (2010). Matching Methods for Causal Inference: A Review and a Look Forward. Statistical Science, 25(1), 1–21. https://doi.org/10.1214/09-STS313
