property of carbon in pi bond that determine a reaction mechanism

[![enter image description here](https://i.stack.imgur.com/UGHxF.png)](https://i.stack.imgur.com/UGHxF.png)


This is a mechanism provided in a problem set in my ochem course.


As far as I know, double bond is electron rich, which is nucleophilic and attacks electrophilic species. In this case, why does one double bond attack another carbon in double bond?


IMO, wouldn't a SN2 reaction make more sense?
[![enter image description here](https://i.stack.imgur.com/a1KdM.png)](https://i.stack.imgur.com/a1KdM.png)




Several points about the question itself. First, the enamine of *n*-butyraldehyde is unquestionably of the (*E*)-configuration and its preparation does not require an acid catalyst. Mannich[[1]](https://doi.org/10.1021/ja00885a021) prepared 1,1-dipiperidinobutane (1,1'-(butane-1,1-diyl)dipiperidine) from piperidine and *n*-butyraldehyde in the presence of potassium carbonate. Elimination to the enamine and piperidine occurred upon distillation. Secondly, the enamine employed in the allylation is that of propionaldehyde.  
  

Whether or not $\ce{S\_N2 or S\_N2'}$ allylation occurs is not straightforward. N-Allylation may be kinetically favored over direct C-allylation. Stork, et al.[[2]](https://i.stack.imgur.com/VHzNG.png) have noted that Cope rearrangement of the N-allylated product leads to a C-allylation aldehyde which would, if C-allylation were kinetically favored, lead to allylation at the more hindered end of the allylic electrophile. The following is from the Stork paper:



> 
> [![Blockquote](https://i.stack.imgur.com/VHzNG.png)](https://i.stack.imgur.com/VHzNG.png)
> 
> 
> 


1. C. Mannich and H. Davidsen, [*Chem. Ber.*, **1936**, *69*, 2106.](https://chemistry-europe.onlinelibrary.wiley.com/doi/10.1002/cber.19360690921)
2. G. Stork, A. Brizzolara, H. Landesman, J. Szmuszkovicz, and R. Terrell, [*J. Am. Chem. Soc*. **1963**, *85*, 207–222.](https://doi.org/10.1021/ja00885a021)


 5