Difference in acid strength of oxalic acid and malonic acid Despite very similar skeletal structures, the difference in acid strength between oxalic acid (ethanedioic acid) and malonic acid (propanedioic acid) is quite significant. What is the reason for that?

It seems that the inductive effect plays a role, but what is the explanation for the inductive effect in oxalic acid as there is same group on opposite sides?

How does the inductive effect plays different roles in both acids?
Linear saturated dicarboxylic acids
$n$ = number of $\ce{-CH_2}-$ groups in chain
 n                        pKa1     pKa2   Ka1/Ka2
 0  Oxalic acid           1.25     4.14   776
 1  Malonic acid          2.83     5.69   724    
 2  Succinic acid         4.21     5.41    15.8
 3  Glutaric acid         4.34     5.41    11.7
 4  Adipic acid           4.41     5.41    10.0 
 5  Pimelic acid          4.50     5.43     8.51
 6  Suberic acid          4.526    5.498    9.4
12  Dodecanedioic acid    4.45     5.05     4.0

Dodecanedioic acid
Aromatic carboxylic acids
                                   pka1     pka2    pka3
 benzoic acid                      4.202    ----    ---- 
 ortho-phthalic acid               2.89     5.51    ----
 meta-phthalic acid                3.46     4.46    ----
 para-phthalic acid                3.51     4.82    ----
 o,o'-bibenzoic acid 
 p,p'-bibenzoic acid
 benzene-1,3,5-tricarboxylic acid  3.12     3.89    4.70

Linear unsaturated dicarboxylic acids
$n$ = number of $\ce{-CH=CH}-$ trans groups in chain
n                            pka1      pka2 
0  Oxalic acid               1.25      4.14
1  Fumaric acid              3.02      4.38
2  trans,trans-Muconic acid  3.87              
3                   

Straight-chain, saturated carboxylic acids
$n =$ total number of carbon atoms in molecule ($n \geqslant 2$ has terminal methyl group).
n                     pKa   
1  Formic acid         3.77
2  Acetic acid         4.76
3  Propionic acid      4.88
4  Butyric acid        4.82
5  Valeric acid        4.82
6  Caproic acid        4.88
15 Pentadecanoic acid  4.8 

most $\mathrm{p}K_\mathrm{a}$ data from Wikipedia.

How does the inductive effect plays different roles in both acids?

First think of what happens when the carboxylic acid group of a straight-chain, saturated carboxylic acids ionizes to form the carboxylate ion. The $\ce{C=O}$ and $\ce{-C-O^{-}}$ bonds of course hybridize. This hybridization occurs faster than hydrogen bonds to the solvent form. The net result is effectively two oxygen atoms with 1/2 a charge each. This increases the ability of the  carboxylate ion to solvate, which increases its acidity.
In malonic acid the $\ce{C-C}$ bond &quot;shares&quot; some of that hybridization. This is the &quot;inductive effect.&quot; The additional delocalization of the electrons from the carbon atoms makes the carboxylate ions more electronegative than they would be in a long linear saturated dicarboxylic acid. So the first ionization ,  the second ionization