No, this is not what GSEA is doing, at least based on my understanding of the method. GSEA asks the question if genes from a gene set are enriched in your RNA-seq data towards being rather up-or downregulated.
In detail: Say you have a gene set, for example genes that are overexpressed in a certain type of cancer. You also have your RNA-seq data which you rank by significance (all genes, not a selection as you ask about). For each gene you calculate a ranking metric, e.g.
-log10(pvalue) * sign(logFC).
sign(logFC) is simply the direction of change, so 1 for genes with a positive-, and negative for genes with a negative fold change. Result will be a ranked list based on the significance of ever gene.
Now you feed this into GSEA. GSEA checks (typically using a permutation-based test) if the gene set genes significantly accumulate on either side of the ranking list, that means if they tend to be globally more upregulated or downregulated in your data.
In the below plot you have on the x-axis the ranked genes, e.g. those with positive ranks towards the left and negative scores towards the right. The ranking is, as said, based on your data. Each black bar represents one gene of the gene set and the position of the bars is determined by checking which rank each gene has in your ranked list. The enrichment score is now a metric that reflects how many genes accumulate at a given position of the x-axis. The curve here peaks to the far left and indicates that (given upregulated genes were ranked to the left of the x-axis) that this gene set is rather overexpressed in this dataset. GSEA also outputs a p-value for this which then helps decide if this is significant.
The idea behind this is the following. If you perform DGE for each gene then many genes might not be significantly different. Still, if many genes from the same pathway (which one could use as a gene set) tend to be modestly but not significantly upregulated then their cumulative effect might still cause a biologically-meaningful effect. It simply depends on the question you ask. Pairwise DGE analysis informs about individual genes while GSEA informs about global trends or the cumulative tendency of gene expression changes.
If you have now a set of genes being significant in your DGE analysis and you want to check if these are enriched for biological functions, e.g. genes being significantly upregulated, then you can use tools such as
R you could use the function
gprofiler2::gost(). This will then check if these genes are significantly enriched in certain pathways.
gprofiler2 for example by default checks against GO terms, KEGG pathways, REACTOME pathways etc. This might be easier to interpret in some situations than a GSEA. If you have a strong phenotype like many genes are changing, then this might be the method of choice. If you have very modest changes and/or assume that the cumulative effect of the genes is biologically-meaningful rather thean the per-gene effect then GSEA might be better. It all depends on the scientific question and context. In
R you could use
fgsea package for GSEA which I personally find the most convenient to use.